﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PcCtrlUI
{
	/// <summary>
	/// Interaction logic for IOCtrl.xaml
	/// </summary>
	public partial class IOCtrl : UserControl
	{
		public IOCtrl()
		{
			this.InitializeComponent();
		}

        public void setValues(bool ena0, bool ena1, bool so, bool s1, bool pcpower)
        {
            Enable_0.IsChecked = ena0;
            Enable_1.IsChecked = ena1;
            s_0.IsChecked = so;
            s_1.IsChecked = s1;
            PC_POWER.IsChecked = pcpower;
        }

        private void Enable_0_Click(object sender, RoutedEventArgs e)
        {
            App app = (App)App.Current;
            app.getMcCOMChannel().setIO(Enable_0.IsChecked.Value, Enable_1.IsChecked.Value);
        }

        private void Enable_1_Click(object sender, RoutedEventArgs e)
        {
            App app = (App)App.Current;
            app.getMcCOMChannel().setIO(Enable_0.IsChecked.Value, Enable_1.IsChecked.Value);
        }


	}
}